PROGRAM polar
IMPLICIT NONE
DOUBLE PRECISION :: x,y,r,theta
REAL,PARAMETER :: PI=3.14159265359
WRITE (*,*), 'Enter r:'; READ *, r  !Reading the values from the user
WRITE (*,*), 'Enter angle(in degree):'; READ *, theta

theta=theta*PI/180 ! converting theta to radians
x=r*COS(theta)
y=r*SIN(theta)

WRITE (*,*),'The Cartesian coordinates are',x,y
 
END PROGRAM

